package com.justnow.offer;

import java.util.Scanner;

/**
 * @author justnow
 * Created on 2020-09-12
 * Description
 */
public class Hwl01 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = scanner.nextInt();
        while (scanner.hasNext()) {
            long a = scanner.nextLong();
            long b = scanner.nextLong();
            long k = scanner.nextLong();
            if (a == b && k % 2 == 0) {
                System.out.println(0);
                continue;
            } else if (a == b && k % 2 != 0) {
                System.out.println(a);
                continue;
            }
            if ( k % 2 == 0) {
                System.out.println((a -b) * (k / 2));
                continue;
            }
            if (k % 2 != 0) {
                System.out.println((a -b ) * (k / 2) + a);
            }
        }
    }
}
